﻿@model ETL.Web.Models.DashboardViewModel
@{
    ViewBag.Title = "Engineer Time Logging";
}
<link rel="stylesheet" type="text/css" href="../../Content/webgrid.css" />

<!--   Ajax - js event functions   -->
<script src="../../Scripts/index-events.js" type="text/javascript"></script>
<script src="../../Scripts/index-functions.js" type="text/javascript"></script>
<!--   Js event functions   -->

<style type="text/css">
.no-title .ui-dialog-titlebar
{
    display : none;
}
</style>
<script type="text/javascript">
    $(document).ready(function () {
        GetProjectData();
        CheckLastActualResourceUsage('@Request.Url.AbsoluteUri');

    });
</script>
@if (ViewBag.IsLeadRole == true)
{
    <div class="navbar">
      <div class="navbar-inner">
        <ul class="nav">
          <li class="active">@Html.ActionLink("Manage My Task", "Index", "EnTimeLog", null, null)</li>
          <li>@Html.ActionLink("Manage My Team's Tasks", "Index", "ManageActualResource", null, null)</li>
        </ul>
      </div>
    </div>
}
<div class="row">
    <div class="span9">
        <div class="row-fluid">
            <div class="span2" style="text-align: left;">
                <label>
                    Engineer</label></div>
            <div class="span10" style="text-align: left;">
                <input id="inputEngineer" name="Engineer" type="text" value="" maxlength="200" size="16" />
            </div>
        </div>
        <div class="row-fluid">
            <div class="span2" style="text-align: left;">
                <label>
                    Project</label></div>
            <div class="span10" style="text-align: left;">
                <div id="ajaxDropDownListProject">
                    <select id="ddlProject" style="width: 580px;">
                        <option value='-1' title='Select a category...'>Select project...</option>
                        @if (Model.ProjectModels != null && Model.ProjectModels.Count() > 0)
                        {
                            foreach (var project in Model.ProjectModels)
                            {
                                //option selected="@project.Selected" value='@project.ProjectId' title='@project.ProjectDescription'
                            <option selected="@project.Selected" value='@project.ProjectId'>
                                @project.DisplayedName
                            </option>
                            }
                        }
                    </select>
                </div>
            </div>
        </div>
        <div style="text-align: right;display:none">
            <input type="checkbox" id="chkOpenProjects" name="Load Open Project" />
            Show all open projects
            <input type="checkbox" id="chkClosedProjects" style="margin-left: 20px;" name="Load Closed Project" />
            Show all closed projects
        </div>
        <br />
        <div class="row-fluid" style="display:none">
            <div class="row-fluid">
                <div class="span2" style="text-align: left;">
                    <label>
                        Lead Engineer</label></div>
                <div class="span3" style="text-align: left;">
                    <input id="inputLeadEngineer" name="Lead Engineer" type="text" value="" maxlength="200"
                        size="16" />
                </div>
                <div class="span7">
                    <div class="row-fluid">
                        <div class="span6">
                            <div class="row-fluid">
                                <div class="span6">
                                    <label>
                                        To Start</label>
                                </div>
                                <div class="span6">
                                    <input id="inputToStart" name="toStart" type="text" class="datepicker" size="8" />
                                </div>
                            </div>
                        </div>
                        <div class="span6">
                            <div class="row-fluid">
                                <div class="span6">
                                    <label>
                                        To Finish</label>
                                </div>
                                <div class="span6">
                                    <input id="inputToFinish" name="toFinish" type="text" class="datepicker" size="8" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="row-fluid" style="display:none">
            <div class="span2" style="text-align: left;">
                <label>
                    Visible Mngs</label></div>
            <div class="span3" style="text-align: left;">
                <select id="ddlEngineers" style="width: 165px;">
                    <option value='-1' title='Select an engineer...'>Select engineer...</option>
                    @if (Model.ProjectUserModels != null && Model.ProjectUserModels.Count() > 0)
                    {
                        foreach (var user in Model.ProjectUserModels)
                        {
                        <option value='@user.Id' title='@user.FirstName'>
                            @user.FullName
                        </option>
                        }
                    }
                </select>
            </div>
            <div class="span7" style="text-align: left;">
                <div class="row-fluid">
                    <div class="span6">
                        <div class="row-fluid">
                            <div class="span6">
                                <label>
                                    Project Status</label>
                            </div>
                            <div class="span6">
                                <input id="inputStatus" name="status" type="text" value="" size="8" />
                            </div>
                        </div>
                    </div>
                    <div class="span6">
                        <div class="row-fluid">
                            <div class="span6">
                                <label>
                                    Completed</label>
                            </div>
                            <div class="span6">
                                <input id="inputCompleted" name="completed" type="text" value="" size="8" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="span3">
        <a class="btn actButtons" id="btnEndOfDay">End of Day</a>
    </div>
</div>
<div class="row" style="margin-top: 10px;">
    <div class="span6">
        <fieldset style="height: 100%;width : 460px;">
            <legend>Your Assigned Tasks</legend>
            <div id="ajaxGridTask">
            </div>
        </fieldset>
    </div>

    <div class="span6" style="margin-left: 30px;">
        <fieldset style="height:  100%;width : 460px;">
            <legend>Time Logged</legend>
            <div id="ajaxGridActualResource">
            </div>
        </fieldset>
    </div>
    
</div>

<div id="LogonModalDialog" style="background-color : White; display : none"></div>
<div id="LoadingDialog" style="background-color : White; display : none"></div>